package com.dubito.muxin.controller;

import com.dubito.muxin.dao.UsersMapper;
import com.dubito.muxin.model.Users;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liliang
 * @description:
 * @date 2018/11/17.
 */
@RestController
public class HelloController {

    @Autowired
    private UsersMapper usersMapper;

    @GetMapping("/hello")
    public String hello() {
        return "Hello Muxin~~~";
    }

    @PostMapping("add")
    public String addUser() {
        Users users = new Users();
        users.setId("1231231231");
        users.setUsername("jack");
        users.setPassword("12323");
        users.setNickname("123456");
        users.setFaceImage("erwerwe");
        users.setQrcode("s234234");
        users.setFaceImageBig("sdfsdfsdfsf");
        users.setCid("234342");
        usersMapper.insert(users);
        return "add user";
    }
}
